/*************************************************
Author: byron
Date: 10/25/2012
Description:
Notes: 
*************************************************/

#ifndef __CSkillCfg_h__
#define __CSkillCfg_h__

#include "commclass.h"
#include "CSkillEffect.h"
#include "CSkillAffect.h"
#include "CSkill.h"
#include "CTHashObjectMgr.h"

class CSkillEffCfg
{
public:
    typedef CTLib::CTHashObjectMgr<unsigned int, CSkillEffect> T_SKILL_EFF_CFG_HASH;

    CSkillEffCfg()
    {
    }

    virtual ~CSkillEffCfg(){}

    static int CountSize()
    {
        return T_SKILL_EFF_CFG_HASH::CountSize(MAX_SKILL_EFF_CFG_COUNT);
    }

    int Init(const char* sBuff)
    {
        return _stSkillEffCfgHash.Init(sBuff, MAX_SKILL_EFF_CFG_COUNT);
    }

    int AddConfig(CSkillEffect& stCfgData);
    int FindConfig(unsigned int uiEffID);
    CSkillEffect& GetConfig(int iIndex);

private:
     T_SKILL_EFF_CFG_HASH _stSkillEffCfgHash;
};

class CSkillAffCfg
{
public:
    typedef CTLib::CTHashObjectMgr<unsigned int, CSkillAffect> T_SKILL_AFF_CFG_HASH;

    CSkillAffCfg()
    {
    }
    virtual ~CSkillAffCfg(){}

    static int CountSize()
    {
        return T_SKILL_AFF_CFG_HASH::CountSize(MAX_SKILL_AFF_CFG_COUNT);
    }

    int Init(const char* sBuff)
    {
        return _stSkillAffCfgHash.Init(sBuff, MAX_SKILL_AFF_CFG_COUNT);
    }

    int AddConfig(CSkillAffect& stCfgData);
    int FindConfig(unsigned int uiAffID);
    CSkillAffect& GetConfig(int iIndex);

private:
     T_SKILL_AFF_CFG_HASH _stSkillAffCfgHash;
};

class CSkillCfg
{
public:
    typedef CTLib::CTHashObjectMgr<unsigned int, CSkill> T_SKILL_CFG_HASH;

    CSkillCfg()
    {
    }

    virtual ~CSkillCfg(){}

    static int CountSize()
    {
        return T_SKILL_CFG_HASH::CountSize(MAX_SKILL_CONFIG_COUNT);
    }

    int Init(const char* sBuff)
    {
        return _stSkillCfgHash.Init(sBuff, MAX_SKILL_CONFIG_COUNT);
    }

    int AddConfig(CSkill& stCfgData);
    int FindConfig(unsigned int uiID);
    CSkill& GetConfig(int iIndex);

private:
     T_SKILL_CFG_HASH _stSkillCfgHash;
};

#endif // __CSkillCfg_h__

